package com.winsomely.leecode;

/**
 * 斐波那契数
 * 
 * @author liujiawei
 *
 */
public class Fib {

	public int fib(int n) {
		if (n == 0) {
			return 0;
		}
		if (n == 1) {
			return 1;
		}
		if (n == 2) {
			return 1;
		}
		int n_2 = 0;
		int n_1 = 1;
		int n_t = 0;
		for (int i = 1; i <= n; i++) {
			n_t = n_2 + n_1;
			n_1 = n_2;
			n_2 = n_t;
		}
		return n_t;
	}

	// 12345
	public static void main(String[] args) {
		Fib t = new Fib();
		System.out.println(t.fib(36));
		
		if(1==1) {
			System.out.println("holle!");
		}
		
		
	}

}
